<template>
	<view class="news">
		<view class="news_item" v-for="item in newsList" :key="item.id" @click="navigator(item.id)">
			<!--  这个接口的图片数据有问题 写死 -->
			<!-- <image  :src="item.img_url">
			</image> -->
			<image src="http://demo.dtcms.net/upload/201504/20/thumb_201504200046589514.jpg" mode=""></image>
			<view class="right">
				<view class="tit">
					{{item.title}}
				</view>
				<view class="info">
					<text>发表时间: {{item.add_time | formatDate}}</text></br>
					<text class="t2">浏览: {{item.click}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:['newsList'],
		data() {
			return {
			}
		},
		onLoad() {
		},
		methods: {
			// 点击跳转 news 详情页
			navigator(id) {
				// console.log(id)
				this.$emit("goNewsDetail",id)
			}
		}
	}
</script>

<style lang="scss">
	.news_item {
		display: flex;
		border-bottom: 1px solid red;
		margin-bottom: 20rpx;
		box-sizing: border-box;
		image {
			// display: block;
			min-width: 200rpx;
			max-width: 200rpx;
			height: 150rpx;
			// height: 200rpx;
			// background-color: pink;
		}
		.right {
			padding: 0 0 0 30rpx;
			.tit {
				margin-bottom: 30rpx;
				font-size: 30rpx;
			}
			.info {
				font-size: 29rpx;
				.t2 {
					// margin-left: 30rpx;
				}
			}
		}
	}
	
</style>
